home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / crc.src < prev    next >
Text File  |  1990-10-20  |  816b  |  22 lines

  1. %%HP: T(3)A(R)F(.);
  2. @ by James Cloos.
  3. @
  4. @  CRC: #CB3Ch and 162.5 bytes.
  5. @
  6. @  Disclaimer:
  7. @  The required wrapper to use it with hexdump strings on the 48
  8. @  is mine.  The thought that this might be the crc algorithm
  9. @  used by BYTES is from reading the src to usrlib (nibble.c [sic]
  10. @  file) Copyright 1990 by HP.  As the algorithm is not theirs,
  11. @  and as I had to write the wrapper, and as I had to then compare
  12. @  it with the output from BYTES to determine if the output would
  13. @  be the same, I felt it is acceptable for me to post & otherwise
  14. @  distribute it.
  15. \<< \-> s
  16.   \<< # 0h 1 s SIZE
  17.     FOR J "#" s J DUP SUB + "h" + STR\-> OVER  @ process one nib at a time
  18.       XOR # Fh AND # 1081h * SWAP SR SR SR SR XOR  @ CRC algorithm
  19.     NEXT # FFFFh AND  @ get last four nibs only
  20.   \>>
  21. \>>
  22.